\(\int \sinh (c+d x) (a+b \tanh ^2(c+d x)) \, dx\) [4]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 19, antiderivative size = 25 \[ \int \sinh (c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\frac {(a+b) \cosh (c+d x)}{d}+\frac {b \text {sech}(c+d x)}{d} \]

[Out]

(a+b)*cosh(d*x+c)/d+b*sech(d*x+c)/d

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {3745, 14} \[ \int \sinh (c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\frac {(a+b) \cosh (c+d x)}{d}+\frac {b \text {sech}(c+d x)}{d} \]

[In]

Int[Sinh[c + d*x]*(a + b*Tanh[c + d*x]^2),x]

[Out]

((a + b)*Cosh[c + d*x])/d + (b*Sech[c + d*x])/d

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 3745

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = Free
Factors[Sec[e + f*x], x]}, Dist[1/(f*ff^m), Subst[Int[(-1 + ff^2*x^2)^((m - 1)/2)*((a - b + b*ff^2*x^2)^p/x^(m
 + 1)), x], x, Sec[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[(m - 1)/2]

Rubi steps \begin{align*} \text {integral}& = -\frac {\text {Subst}\left (\int \frac {a+b-b x^2}{x^2} \, dx,x,\text {sech}(c+d x)\right )}{d} \\ & = -\frac {\text {Subst}\left (\int \left (-b+\frac {a+b}{x^2}\right ) \, dx,x,\text {sech}(c+d x)\right )}{d} \\ & = \frac {(a+b) \cosh (c+d x)}{d}+\frac {b \text {sech}(c+d x)}{d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.22 (sec) , antiderivative size = 45, normalized size of antiderivative = 1.80 \[ \int \sinh (c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\frac {a \cosh (c) \cosh (d x)}{d}+\frac {b \cosh (c+d x)}{d}+\frac {b \text {sech}(c+d x)}{d}+\frac {a \sinh (c) \sinh (d x)}{d} \]

[In]

Integrate[Sinh[c + d*x]*(a + b*Tanh[c + d*x]^2),x]

[Out]

(a*Cosh[c]*Cosh[d*x])/d + (b*Cosh[c + d*x])/d + (b*Sech[c + d*x])/d + (a*Sinh[c]*Sinh[d*x])/d

Maple [A] (verified)

Time = 0.21 (sec) , antiderivative size = 44, normalized size of antiderivative = 1.76

method result size
derivativedivides \(\frac {a \cosh \left (d x +c \right )+b \left (\frac {\sinh \left (d x +c \right )^{2}}{\cosh \left (d x +c \right )}+\frac {2}{\cosh \left (d x +c \right )}\right )}{d}\) \(44\)
default \(\frac {a \cosh \left (d x +c \right )+b \left (\frac {\sinh \left (d x +c \right )^{2}}{\cosh \left (d x +c \right )}+\frac {2}{\cosh \left (d x +c \right )}\right )}{d}\) \(44\)
risch \(\frac {{\mathrm e}^{d x +c} a}{2 d}+\frac {{\mathrm e}^{d x +c} b}{2 d}+\frac {{\mathrm e}^{-d x -c} a}{2 d}+\frac {{\mathrm e}^{-d x -c} b}{2 d}+\frac {2 b \,{\mathrm e}^{d x +c}}{d \left ({\mathrm e}^{2 d x +2 c}+1\right )}\) \(81\)

[In]

int(sinh(d*x+c)*(a+b*tanh(d*x+c)^2),x,method=_RETURNVERBOSE)

[Out]

1/d*(a*cosh(d*x+c)+b*(sinh(d*x+c)^2/cosh(d*x+c)+2/cosh(d*x+c)))

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 42, normalized size of antiderivative = 1.68 \[ \int \sinh (c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\frac {{\left (a + b\right )} \cosh \left (d x + c\right )^{2} + {\left (a + b\right )} \sinh \left (d x + c\right )^{2} + a + 3 \, b}{2 \, d \cosh \left (d x + c\right )} \]

[In]

integrate(sinh(d*x+c)*(a+b*tanh(d*x+c)^2),x, algorithm="fricas")

[Out]

1/2*((a + b)*cosh(d*x + c)^2 + (a + b)*sinh(d*x + c)^2 + a + 3*b)/(d*cosh(d*x + c))

Sympy [F]

\[ \int \sinh (c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\int \left (a + b \tanh ^{2}{\left (c + d x \right )}\right ) \sinh {\left (c + d x \right )}\, dx \]

[In]

integrate(sinh(d*x+c)*(a+b*tanh(d*x+c)**2),x)

[Out]

Integral((a + b*tanh(c + d*x)**2)*sinh(c + d*x), x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 67 vs. \(2 (25) = 50\).

Time = 0.21 (sec) , antiderivative size = 67, normalized size of antiderivative = 2.68 \[ \int \sinh (c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\frac {1}{2} \, b {\left (\frac {e^{\left (-d x - c\right )}}{d} + \frac {5 \, e^{\left (-2 \, d x - 2 \, c\right )} + 1}{d {\left (e^{\left (-d x - c\right )} + e^{\left (-3 \, d x - 3 \, c\right )}\right )}}\right )} + \frac {a \cosh \left (d x + c\right )}{d} \]

[In]

integrate(sinh(d*x+c)*(a+b*tanh(d*x+c)^2),x, algorithm="maxima")

[Out]

1/2*b*(e^(-d*x - c)/d + (5*e^(-2*d*x - 2*c) + 1)/(d*(e^(-d*x - c) + e^(-3*d*x - 3*c)))) + a*cosh(d*x + c)/d

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 63 vs. \(2 (25) = 50\).

Time = 0.29 (sec) , antiderivative size = 63, normalized size of antiderivative = 2.52 \[ \int \sinh (c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\frac {a {\left (e^{\left (d x + c\right )} + e^{\left (-d x - c\right )}\right )} + b {\left (e^{\left (d x + c\right )} + e^{\left (-d x - c\right )}\right )} + \frac {4 \, b}{e^{\left (d x + c\right )} + e^{\left (-d x - c\right )}}}{2 \, d} \]

[In]

integrate(sinh(d*x+c)*(a+b*tanh(d*x+c)^2),x, algorithm="giac")

[Out]

1/2*(a*(e^(d*x + c) + e^(-d*x - c)) + b*(e^(d*x + c) + e^(-d*x - c)) + 4*b/(e^(d*x + c) + e^(-d*x - c)))/d

Mupad [B] (verification not implemented)

Time = 1.74 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.08 \[ \int \sinh (c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\frac {b}{d\,\mathrm {cosh}\left (c+d\,x\right )}+\frac {\mathrm {cosh}\left (c+d\,x\right )\,\left (a+b\right )}{d} \]

[In]

int(sinh(c + d*x)*(a + b*tanh(c + d*x)^2),x)

[Out]

b/(d*cosh(c + d*x)) + (cosh(c + d*x)*(a + b))/d